package com.gadgets.busi.bm02.common;

import com.gadgets.framework.common.constant.GadgetsConstant;

/**
 * @author UncleXiu
 * @version V1.0.0
 * @data 2020-11-02
 *
 */
public class GadgetsBm02Constant {

    /**
     * 模块编号
     */
    public static final String MODUEL_NO = "bm02";
    /**
     * 数据分析模块编号
     */
    public static final String DA_MODUEL_NO = "bm02-da";
    /**
     * 合成表快速集合缓存
     */
    public static final String RECIPE_FAST_RESULT = "recipeFastResult";

    /**
     * 原始物品标记-是
     */
    public static final String ORI_FLAG_YES = GadgetsConstant.NUMBER_CONSTANT.STR_NUMBER_1;
    /**
     * 原始物品标记-否
     */
    public static final String ORI_FLAG_NO = GadgetsConstant.NUMBER_CONSTANT.STR_NUMBER_0;
    /**
     * MC物品字典Key
     */
    public static final String DICT_CACHE_KEY = "McCacheKey";

    public static class MATERIAL_CONFIG{
        /**
         * 所属 MOD 标签<materials mod=""></materials>
         */
        public static final String ATTR_MATERIALS_MOD = "mod";
        /**
         * 合成表标签<recipe></recipe>
         */
        public static final String ELE_RECIPE = "recipe";
        /**
         * 合成表原料标签<recipe></recipe>
         */
        public static final String ELE_RECIPE_ITEM = "item";
        /**
         * 根标签<materials></materials>
         */
        public static final String ELE_MATERIALS = "materials";
        /**
         * 物品标签<material></material>
         */
        public static final String ELE_MATERIAL = "material";
        /**
         * 物品是否基础物品属性<material basic=""></material>
         */
        public static final String ATTR_MATERIAL_ORI = "basic";
        /**
         * 物品是否基础物品名称<material name=""></material>
         */
        public static final String ATTR_MATERIAL_NAME = "name";
        /**
         * 物品所属MOD<material mod=""></material>
         */
        public static final String ATTR_MATERIAL_MOD = "mod";
        /**
         * 合成表产出数量属性<recipe productUnit=""></recipe>
         */
        public static final String ATTR_RECIPE_PRODUCT_UNIT = "productUnit";
        /**
         * 合成表产出耗能种类属性<recipe energy=""></recipe>
         */
        public static final String ATTR_RECIPE_ENERGY_TYPE = "energy";
        /**
         * 合成表产出耗能种类数量属性<recipe energyNum=""></recipe>
         */
        public static final String ATTR_RECIPE_ENERGY_NUM = "energyNum";
        /**
         * 合成表产出耗能种类数量属性<recipe energyNumType=""></recipe>
         */
        public static final String ATTR_RECIPE_ENERY_NUM_TYPE = "energyNumType";
        /**
         * 合成表原料名称属性<item name=""></item>
         */
        public static final String ATTR_ITEM_NAME = "name";
        /**
         * 合成表原料需求数量<item demandNum=""></item>
         */
        public static final String ATTR_ITEM_DEMAND_NUM = "demandNum";
        /**
         * 合成表原料所属MOD<item mod=""></item>
         */
        public static final String ATTR_ITEM_MOD = "mod";
    }

    /**
     * 能源换算比例常量
     */
    public static enum ENERGY_TRANSLATE_TYPE{
        /**
         * EU换算EU——比率1
         */
        EU(1.0),
        /**
         * AE换算EU——比率0.5
         */
        AE(0.5),
        /**
         * RF换算EU——比率
         */
        MJ(1.0*4/15)
        ;
        /**
         * 换算比率
         */
        private final double rate;

        ENERGY_TRANSLATE_TYPE(double v) {
            this.rate = v;
        }

        public double getRate() {
            return rate;
        }

    }

    /**
     * 能源常量
     */
    public static enum  ENERGY_NUM_TYPE{
        /**
         * 打粉机耗能
         */
        打粉机(800),
        /**
         * 压缩机耗能
         */
        压缩机(600),
        /**
         * 高炉耗能
         */
        高炉(180000),
        /**
         * 提取机耗能
         */
        提取机(800),
        /**
         * 电炉
         */
        电炉(400),
        /**
         * 压印器
         */
        压印器(1010),
        /**
         * 金属成型机
         */
        金属成型机(2000),
        /**
         * 默认
         */
        BLANK(0);
        /**
         * 能量消耗数
         */
        private final double energyNum;

        ENERGY_NUM_TYPE(double energyNum) {
            this.energyNum = energyNum;
        }

        public double getEnergyNum() {
            return energyNum;
        }
    }

    /**
     * 原料种类权值
     */
    public static enum MATERIAL_TYPE_WEIGHT{
        /**
         * 1种原料
         */
        T1("material.type.weight.1"),
        /**
         * 2种原料
         */
        T2("material.type.weight.2"),
        /**
         * 3种原料
         */
        T3("material.type.weight.3"),
        /**
         * 4种原料
         */
        T4("material.type.weight.4"),
        /**
         * 5种原料
         */
        T5("material.type.weight.5"),
        /**
         * 6种原料
         */
        T6("material.type.weight.6"),
        /**
         * 7种原料
         */
        T7("material.type.weight.7"),
        /**
         * 8种原料
         */
        T8("material.type.weight.8"),
        /**
         * 9种原料
         */
        T9("material.type.weight.9");
        /**
         * 权值属性名
         */
        private final String propName;

        MATERIAL_TYPE_WEIGHT(String propName) {
            this.propName = propName;
        }

        public String getPropName() {
            return propName;
        }
    }

    /**
     * MC合成权值计算策略
     */
    public static class MC_RECIPE_WEIGHT_POLICY{
        /**
         * 综合最低权
         */
        public static final String MIN_GATEWAY = "MG";
    }

    /**
     * Excel — Sheet页名称
     */
    public static class MC_EXCEL_EXPORT_SHEET{
        /**
         * 合成表Sheet页
         */
        public static final String RECIPE_TREE_SHEET = "合成表";
        /**
         * 原料表Sheet页
         */
        public static final String MATERIAL_SHEET = "原料表";
    }

}
